package com.designPattern.observer;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2016</p>
 * <p>Company: Sunshine Insurance Group Co., Ltd.</p>
 *
 * @author lbb
 * @version 1.0
 * 修改记录：
 * 修改序号，修改日期，修改人，修改内容
 */
public class Xiaomei {


    private List<Person> customers = new ArrayList<>();

    public void addCustomer(Person customer){
        this.customers.add(customer);
    }
    //模拟报纸来了
    public void newspaperCome(){
        this.notifyAllObservers();
    }

    public void notifyAllObservers(){
        for (Person customer : customers){
            customer.getMessage();
        }
    }


}
